<template>
	<view>
		<view class="top-bg"></view>
		<view class="content-wrap">
			<view class="list-wrap">
				<txl @ev="evFunc" :datas="userList" :index="true" name="userName"></txl>
			</view>
		</view>
	</view>
</template>

<script>
	import txl from '@/components/yt-txl/index.vue';

	export default {
		components: {
			txl
		},
		data() {
			return {
				userList: [],
				deptId: ""
			}
		},
		onLoad(options) {
			this.deptId = options.deptId;
			this.dayPunchList();
		},
		methods: {
			evFunc(e) {
				console.log(e, "eeeeeeeeeeeeeee")
				uni.$emit('updateUser', e);
				this.$Router.navigateBack();
			},
			//通讯录
			dayPunchList() {
				this.$api.showLoading()
				this.$apis.userList({
					deptId: this.deptId
				}).then((res) => {
					this.$api.hideLoading()
					console.log(res, '@@@@@@@@')
					if (res.code == 0) {
						this.userList = res.data
					} else {}
				}).catch(() => {
					setTimeout(()=>{
						this.$api.hideLoading()
					},1500)
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #F4F8FB;
	}

	.top-bg {
		background: #3291F8;
		width: 100%;
		height: 200rpx;
		position: fixed;
		top: 0;
		left: 0;
	}

	.content-wrap {
		padding: 0 30rpx 30rpx;
		margin-top: 60rpx;
		width: 100%;
		z-index: 2;
		position: relative;

		.list-wrap {
			height: 90vh;
			border-radius: 20rpx;
			background: #fff;
			padding: 24rpx;
			box-shadow: 0px 2rpx 6rpx 0px rgba(180, 180, 180, 40);
			overflow: hidden;
		}
	}
</style>